import React, { Component } from 'react'
import { string, func, element, oneOfType } from 'prop-types'
import './style.scss'

class SearchBtn extends Component {
  render() {
    return (
      <div className="searchbtn-container" onClick={this.props.onClick}>
        <img src="http://img.1314000.cn/icon/search.png" alt="" />
        <span>{this.props.title}</span>
      </div>
    )
  }
}

SearchBtn.propTypes = {
  onClick: func,
  title: oneOfType([string, element])
}
SearchBtn.defaultProps = {
  onClick: () => {},
  title: '搜索你要找的菜'
}

export default SearchBtn
